/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package we.dispatcher;

import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;

/**
 *
 * @author trungdv2
 */
public class CMessage implements IDisposable
{

    public SelectionKey key;
    public ByteBuffer data;
    public boolean handshake;

    public CMessage(SelectionKey key, ByteBuffer buffer, boolean hanshake)
    {
        this.key = key;
        this.data = buffer;
        this.handshake = hanshake;
    }

    public CMessage(SelectionKey key, ByteBuffer buffer)
    {
        this.key = key;
        this.data = buffer;
        this.handshake = false;;
    }

    @Override
    public void dispose()
    {
        key = null;
        data = null;
    }
}
